package com.teacher.hong.dao;

import com.teacher.hong.entity.SystemLog;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.Arrays;

/**
 * 系统日志数据访问层
 */
@Repository
public class SystemLogDao {

    @Resource
    BaseDao baseDao;


    /**
     * 新增系统日志
     * @param systemLog
     * @return
     */
    public int insert(SystemLog systemLog) throws SQLException {
        return baseDao.update("insert into system_log values(default, ?, ?, ?, ?, now())",
                Arrays.asList(systemLog.getMethod(), systemLog.getNotice(), systemLog.getParamCount(), systemLog.getReturnValue()));
    }

}
